package com.zhuss.controller.team;

import com.zhuss.bean.bo.team.information.CreateInfoBo;
import com.zhuss.bean.bo.team.information.DeleteInfoBo;
import com.zhuss.bean.bo.team.information.UpdateInfoBo;
import com.zhuss.common.BaseController;
import com.zhuss.common.OperateService;
import com.zhuss.exception.WpsException;
import com.zhuss.team.information.InformationOperateServiceExt;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: zhushanshuo
 * @Date: 2020/3/3 15:18
 */
@RestController
@RequestMapping("/information")
public class InformationOperateController extends BaseController {

    @Autowired
    @Qualifier("informationOperateService")
    private OperateService<Void, Object> informationOperateService;

    @Autowired
    @Qualifier("informationOperateServiceExt")
    private InformationOperateServiceExt informationOperateServiceExt;

    /**
     * 新建
     * @throws WpsException
     */
    @ResponseBody
    @PostMapping("/create")
    public void create(@RequestBody CreateInfoBo bo) throws WpsException {
        informationOperateService.create(bo);
    }

    /**
     * 修改
     * @throws WpsException
     */
    @ResponseBody
    @PostMapping("/update")
    public void update(@RequestBody UpdateInfoBo bo) throws WpsException {
        informationOperateService.update(bo);
    }

    /**
     * 删除
     * @throws WpsException
     */
    @ResponseBody
    @PostMapping("/delete")
    public void delete(@RequestBody DeleteInfoBo bo) throws WpsException {
        informationOperateService.delete(bo);
    }
}
